package com.wicket.okrbff.web.contorller;

import com.wicket.okrbff.biz.service.BusinessObjectService;
import com.wicket.okrbff.biz.service.dto.req.*;
import com.wicket.okrbff.biz.service.dto.res.*;
import com.wicket.okrbff.common.ro.OkrResult;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RestController;
import com.wicket.okrframework.integration.FwBaseBusinessObjectClient;
import com.wicket.okrframework.integration.dto.AddInductionRecordRespDto;
import com.wicket.okrframework.integration.dto.AddInductionRecordReqDto;
import com.wicket.okrframework.integration.FwBaseInductionRecordClient;
import com.wicket.okrframework.integration.dto.UndoToArchiveInductionRecordRespDto;
import com.wicket.okrframework.integration.dto.UndoToArchiveInductionRecordReqDto;
import com.wicket.okrbff.common.exception.Assert;
import com.wicket.okrframework.integration.dto.QueryObjTypeRelationListRespDto;
import com.wicket.okrframework.integration.dto.QueryObjTypeRelationListReqDto;
import cn.hutool.core.bean.BeanUtil;
import java.util.stream.Collectors;

/**
 * @author ：
 * @date ：
 *
 *
 * @version 1.0
 */
@Api(value = "BusinessObject", tags = {"BusinessObject"})
@RestController
// @RequestMapping("/oms/businessObject/")
public class BusinessObjectController {

    @Autowired
    BusinessObjectService businessObjectService;



    /**
   * B1-1查询对象属性类型关系列表(边界)
   * gen by moon at 8/10/2022, 3:38:24 AM
   */
    @PostMapping("/oms/businessObject/queryObjTypeRelationListBorder")
    @ApiOperation(value = "B1-1查询对象属性类型关系列表(边界)", response = OkrResult.class)
    public OkrResult<BffQueryObjTypeRelationListBorderRespDto> queryObjTypeRelationListBorder(@RequestBody(required=false) @Validated BffQueryObjTypeRelationListBorderReqDto reqDTO){
        return OkrResult.success(businessObjectService.queryObjTypeRelationListBorder(reqDTO));
    }


    /**
   * B1-3撤销存档就职记录（管理）
   * gen by moon at 9/1/2022, 5:34:14 PM
   */
    @PostMapping("/oms/mgt/inductionRecord/undoArchiveInductionRecord")
    @ApiOperation(value = "B1-3撤销存档就职记录（管理）", response = OkrResult.class)
    public OkrResult<BffUndoArchiveInductionRecordRespDto> undoArchiveInductionRecord(@RequestBody(required=false) @Validated BffUndoArchiveInductionRecordReqDto reqDTO){
        return OkrResult.success(businessObjectService.undoArchiveInductionRecord(reqDTO));
    }


    /**
     * B1-1删除业务场景
     */
    @PostMapping("/oms/platform/appScene/deleteBizScene")
    @ApiOperation(value = "B1-1删除业务场景", response = OkrResult.class)
    public OkrResult<BffDeleteBizSceneRespDto> deleteBizScene(@RequestBody(required = false) @Validated BffDeleteBizSceneReqDto reqDTO) {
        return OkrResult.success(businessObjectService.deleteBizScene(reqDTO));
    }

    /**
     * B1-1删除业务应用
     */
    @PostMapping("/oms/platform/appScene/deleteBizAppScene")
    @ApiOperation(value = "B1-1删除业务应用", response = OkrResult.class)
    public OkrResult<BffDeleteBizAppSceneRespDto> deleteBizAppScene(@RequestBody(required = false) @Validated BffDeleteBizAppSceneReqDto reqDTO) {
        return OkrResult.success(businessObjectService.deleteBizAppScene(reqDTO));
    }

}
